package top.dark.design.patterns.decorator;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Author: Darkn
 * description:
 * Create Time: 2021/4/27 10:57
 */
@Data
@NoArgsConstructor
public class Decorator extends Drink {
    private Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public Double cost() {
        return super.getPrice() + drink.cost();
    }
}
